package com.wedistudio.android.framework.xml;

public class XMLTools {

	static public String extract(String xml, String tag) {
		int idxBegin = xml.indexOf("<" + tag);
		if (idxBegin < 0)
			return "";

		int idxEnd = xml.indexOf("</" + tag + ">", idxBegin);
		if (idxEnd < 0)
			return xml.substring(idxBegin);

		return xml.substring(idxBegin, idxEnd + tag.length() + 3);
	}

	static public String substract(String xml, String tag) {
		return xml.replace(extract(xml, tag), "");
	}
}
